package com.dinzeer.slashblade_useful_addon.register;

import com.dinzeer.slashblade_useful_addon.Slashblade_useful_addon;
import mods.flammpfeil.slashblade.SlashBlade;
import mods.flammpfeil.slashblade.SlashBladeCreativeGroup;
import mods.flammpfeil.slashblade.init.SBItems;
import mods.flammpfeil.slashblade.item.ItemSlashBlade;
import net.minecraft.core.registries.Registries;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.RegistryObject;

import static com.dinzeer.slashblade_useful_addon.Slashblade_useful_addon.MODID;


public class SUACreativeTab {
    public static final DeferredRegister<CreativeModeTab> REGISTRY = DeferredRegister.create(Registries.CREATIVE_MODE_TAB, MODID);
    public static final RegistryObject<CreativeModeTab> SUA_TAB = REGISTRY.register("slashblade_useful_addon",
            () -> CreativeModeTab.builder()
                    .withTabsBefore(SlashBladeCreativeGroup.SLASHBLADE_GROUP.getId())
                    .title(Component.translatable("item_group.Slashblade_useful_addon.Slashblade_useful_addon")).icon(() -> {
                        ItemStack stack = new ItemStack(SBItems.slashblade);
                        stack.getCapability(ItemSlashBlade.BLADESTATE).ifPresent(s -> {
                            s.setModel(new ResourceLocation(SlashBlade.MODID, "model/named/agito.obj"));
                            s.setTexture(new ResourceLocation(SlashBlade.MODID, "model/named/a_tukumo.png"));
                        });
                        return stack;
                    })
                    .displayItems((parameters, tabData) -> {
                    })
                    .build());
}
